<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"  xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:replace="_header_include::frag(~{::title},~{},~{})">
    <title>后台管理系统</title>
    <style>
    </style>
</head>
<body>
<div id="maindiv" class="maindiv mainPadding" style="display: none;">    
    <el-breadcrumb separator="/" class="elBreadcrumb marginB20">
        <el-breadcrumb-item>Home</el-breadcrumb-item>
        <el-breadcrumb-item>数据报表</el-breadcrumb-item>
        <el-breadcrumb-item>资源接通有效率表</el-breadcrumb-item>
    </el-breadcrumb>    
    <el-row class="marginB20">
        <el-button type="primary" @click="searchYesterday">昨天</el-button>
        <el-button type="success" @click="searchWeek">近七天</el-button>
        <el-button type="warning" @click="searchMonth">本月</el-button>  
        <el-button type="danger" @click="exportRs">导出Excel报表</el-button>   
    </el-row>
    <div class="mainSearchBg">        
        <div class="mainSearchFormBox">
           <el-form :inline="true" :model="form" class="demo-form-inline mainSearchForm" ref="form">                 
                <el-form-item label="起止时间:">
                    <el-date-picker format="yyyy-MM-dd HH:mm" v-model="form.startTime" value-format="yyyy-MM-dd HH:mm" type="datetime" placeholder="选择日期"></el-date-picker>
                </el-form-item>
                <el-form-item label="—" class="widthauto">
                   <el-date-picker format="yyyy-MM-dd HH:mm" v-model="form.endTime" value-format="yyyy-MM-dd HH:mm" type="datetime" placeholder="选择日期"></el-date-picker>
                </el-form-item>
                <el-form-item label="资源类别:">  
                    <el-select v-model="form.resourceClassId" placeholder="资源类别" style="width: 100%;" clearable filterable>
                        <el-option
                            v-for="item in resourceClassArr"
                            :key="item.id"
                            :label="item.name"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="媒介:">  
                    <el-select v-model="form.mediumId" placeholder="媒介" style="width: 100%;" clearable filterable>
                        <el-option
                            v-for="item in mediumArr"
                            :key="item.id"
                            :label="item.name"
                            :value="item.value">
                        </el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="资源项目:">  
                    <el-select v-model="form.resourceProjectId" placeholder="资源项目" style="width: 100%;" clearable filterable>
                        <el-option
                            v-for="item in resourceProjectArr"
                            :key="item.id"
                            :label="item.projectName"
                            :value="item.id">
                        </el-option>
                    </el-select>
                </el-form-item>
                <div class="mainSearchBtnBox">
                    <el-button icon="el-icon-search" type="primary" @click="searchTable(1)" class="searchBtn">搜索</el-button>
                </div>  
            </el-form>
        </div>
        <!-- tabs -->
        <el-row class="tabsC" v-loading="loading">
            <el-tabs v-model="activeName" @tab-click="handleClick('tab')">
    		    <el-tab-pane label="资源有效" name="0">
                    <el-table 
                        ref="tableDataFirst"
                        tooltip-effect="dark"
                        style="width: 100%"
                        border
                        :data="tableDataFirst"
                        
                        :span-method="arraySpanMethod">
                        <!-- <el-table-column type="index" label="序号" align="center" width="55" :index="indexFun"></el-table-column> -->
                        <el-table-column prop="resourceCategoryName" align="center" label="资源类别" width="80">
                        </el-table-column>
                        <el-table-column prop="resourceMediumName" align="center" label="媒介">
                        </el-table-column>
                        <el-table-column prop="projectTypeName" align="center" label="资源项目">
                        </el-table-column>
                        <el-table-column prop="issuedResources" align="center" label="下发资源量" width="80">
                        </el-table-column>
                        <el-table-column prop="followResources" align="center" label="跟访资源量" width="80">
                        </el-table-column>
                        <el-table-column prop="firstResources" align="center" label="首次接通资源量" width="110">
                        </el-table-column>
                        <el-table-column prop="connectResources" align="center" label="接通资源量" width="80">
                        </el-table-column>
                        <el-table-column prop="notConnectResources" align="center" label="未接通资源量" width="100">
                        </el-table-column>
                        <el-table-column prop="connectEffectiveResources" align="center" label="接通有效资源量" width="110">
                        </el-table-column>
                        <el-table-column prop="connectNotEffectiveResources" align="center" label="接通无效资源量" width="110">
                        </el-table-column>
                        <el-table-column prop="notConnectEffectiveResources" align="center" label="未接通有效资源量" width="120">
                        </el-table-column>
                        <el-table-column prop="notConnectNotEffectiveResources" align="center" label="未接通无效资源量" width="120">
                        </el-table-column>
                        <el-table-column prop="followRate" align="center" label="跟访率" :formatter="percentFormat" width="80">
                        </el-table-column>
                        <el-table-column prop="firstRate" align="center" label="首次接通率" :formatter="percentFormat" width="80">
                        </el-table-column>
                        <el-table-column prop="issuedConnectRate" align="center" label="下发接通率" :formatter="percentFormat" width="80">
                        </el-table-column>
                        <el-table-column prop="issuedEffectiveRate" align="center" label="下发有效率" :formatter="percentFormat" width="80">
                        </el-table-column>
                        <el-table-column prop="resourceConnectRate" align="center" label="跟进接通率" :formatter="percentFormat" width="80">
                        </el-table-column>
                        <el-table-column prop="resourceEffectiveRate" align="center" label="跟进有效率" :formatter="percentFormat" width="80">
                        </el-table-column>
                        <el-table-column prop="connectionRate" align="center" label="接通有效率" :formatter="percentFormat" width="80">
                        </el-table-column>
                    </el-table>
                    <table-pagination :pager="pager" @change="handleClick('page')"></table-pagination>
    			</el-tab-pane>
    		    <el-tab-pane label="首日资源有效" name="1">
                    <el-table 
                        ref="tableDataSecond"
                        tooltip-effect="dark"
                        style="width: 100%"
                        border
                        :data="tableDataSecond"
                        
                        :span-method="arraySpanMethod">
                        <el-table-column prop="resourceCategoryName" align="center" label="资源类别" width="80">
                        </el-table-column>
                        <el-table-column prop="resourceMediumName" align="center" label="媒介">
                        </el-table-column>
                        <el-table-column prop="projectTypeName" align="center" label="资源项目">
                        </el-table-column>
                        <el-table-column prop="issuedResources" align="center" label="下发资源量" width="80">
                        </el-table-column>
                        <el-table-column prop="followResources" align="center" label="首日跟访资源量" width="110">
                        </el-table-column>
                        <el-table-column prop="connectResources" align="center" label="首日接通资源量" width="110">
                        </el-table-column>
                        <el-table-column prop="notConnectResources" align="center" label="首日未接通资源量" width="120">
                        </el-table-column>
                        <el-table-column prop="connectEffectiveResources" align="center" label="首日接通有效资源量" width="140">
                        </el-table-column>
                        <el-table-column prop="connectNotEffectiveResources" align="center" label="首日接通无效资源量" width="140">
                        </el-table-column>
                        <el-table-column prop="notConnectEffectiveResources" align="center" label="首日未接通有效资源量" width="150">
                        </el-table-column>
                        <el-table-column prop="notConnectNotEffectiveResources" align="center" label="首日未接通无效资源量" width="150">
                        </el-table-column>
                        <el-table-column prop="followRate" align="center" label="首日跟访率" :formatter="percentFormat" width="80">
                        </el-table-column>
                        <el-table-column prop="issuedConnectRate" align="center" label="首日下发接通率" :formatter="percentFormat" width="110">
                        </el-table-column>
                        <el-table-column prop="issuedEffectiveRate" align="center" label="首日下发有效率" :formatter="percentFormat" width="110">
                        </el-table-column>
                        <el-table-column prop="resourceConnectRate" align="center" label="首日跟进接通率" :formatter="percentFormat" width="110">
                        </el-table-column>
                        <el-table-column prop="resourceEffectiveRate" align="center" label="首日跟进有效率" :formatter="percentFormat" width="110">
                        </el-table-column>
                         <el-table-column prop="connectionRate" align="center" label="首日接通有效率" :formatter="percentFormat" width="110">
                        </el-table-column>
                    </el-table>
                    <table-pagination :pager="pager" @change="handleClick('page')"></table-pagination>   
                </el-tab-pane>
    		 </el-tabs>
        </el-row>
        <!-- tabs -->
    </div>
</div>
<!-- import common js-->
<div th:include="_footer_include :: #jsLib"></div>
<style>
    .el-table--border th:nth-of-type(n+19) .cell {
        /*font-weight: bold;*/
        /*color: #008000;*/
    }
    .el-table tr:nth-of-type(1) td:nth-of-type(n+1) {
        font-weight: bold;
        /*color: #108ee9*/;
    }
    .tabsC #tab-0, .tabsC #tab-1 {
        width: 124px;
        height: 40px;
        padding: 0;
        text-align: center;
    }
    .tabsC #tab-0 {
        border-top-left-radius: 8px;
    } 
    .tabsC #tab-1 {
        border-top-right-radius: 8px;
    }
    .el-pagination{
        height: 30px;
    }
</style>
</body>
<script th:inline="javascript">
    var resourceClassArr = [[${clueCategoryList}]]; //资源类别
    var mediumArr = [[${mediumList}]]; //媒介集合
    var resourceProjectArr = [[${projectList}]]; //所有项目

    var search_url = ["/statistics/resourceEfficiency/getResourceEfficientList","/statistics/resourceEfficiency/getFirstResourceEfficientList"];
    
    var mainDivVM = new Vue({
        el: '#maindiv',
        data: function() {
            return {
                activeName: '0',

                tableDataFirst: [],
                tableDataSecond: [],

                loading: false,
                isDisabled: false,

                startTimeEnd:'',
                endTimeEnd:'',
                resourceClassIdEnd: '',
                mediumIdEnd: '',
                resourceProjectIdEnd: '',
                form: {
                    startTime:'',
                    endTime:'',
                    resourceClassId: "",
                    mediumId: "",
                    resourceProjectId: "",
                },
                export: {
                    startTime:'',
                    endTime:'',
                    resourceClassId: "",
                    mediumId: "",
                    resourceProjectId: "",
                },
                pager:{ 
                    total: 0,
                    currentPage: 1,
                    pageSize: 20
                },
                resourceClassArr: resourceClassArr,
                mediumArr: mediumArr,
                resourceProjectArr: resourceProjectArr
            }             
        },
        methods: {
       	   	formatTreeList(dataArr) {
                for(var j = 0; j < dataArr.length;j++){
                    for(var k = j+1 ; k < dataArr.length;k++){
                        if(dataArr[j].resourceCategoryName == dataArr[k].resourceCategoryName){
                            dataArr[k].resourceCategoryName = ''
                            if(dataArr[j].resourceMediumName == dataArr[k].resourceMediumName){
                                dataArr[k].resourceMediumName = ''
                            }
                        }

                    }
                }
                return dataArr;
            },
            handleClick(tab) {
                //console.log(tab, event);
                this.form.startTime = this.startTimeEnd;
                this.form.endTime = this.endTimeEnd;
                this.form.resourceClassId = this.resourceClassIdEnd;
                this.form.mediumId = this.mediumIdEnd;
                this.form.resourceProjectId = this.resourceProjectIdEnd;
                //this.searchTable(1);
                if( tab=='tab' ){
                    this.searchTable(1);
                }else{
                    this.searchTable();
                }

            },            
            searchTable(firstPage) { 

                var startTime = this.form.startTime;
                var endTime = this.form.endTime;
                if(endTime && startTime){
                    startTime = new Date(this.form.startTime);
                    endTime = new Date(this.form.endTime);
                    if(startTime>endTime){
                        this.$message({
                            message: '开始时间不能大于结束时间',
                            type: 'warning'
                        });
                        return;
                    }
                    var date = new Date();
                    var currentDate = moment(date).format("YYYY-MM-DD 23:59");
                    date.setMonth(date.getMonth()-6);
                    var beforeSixMonth = moment(date).format("YYYY-MM-DD 00:00");
                    var currentDateRes = new Date(currentDate);
                    var beforeSixMonthRes = new Date(beforeSixMonth);
                    if(startTime < beforeSixMonthRes || endTime > currentDateRes){
                        this.$message({
                            message: '请选择近6个月内的时间',
                            type: 'warning'
                        });
                        return;
                    }
                    startTime = this.limitTime(startTime, null);
                    endTime = this.limitTime(null, endTime);
                }else{
                    this.$message({
                        message: '请选择起止时间',
                        type: 'warning'
                    });
                    return;
                }   
                
                var param = {};
                param.startTime = this.minuteFormat(startTime);
                param.endTime = this.minuteFormat(endTime);
                param.pageSize = this.pager.pageSize;
                if(firstPage){
                    param.pageNum = firstPage;
                }else{
                    param.pageNum = this.pager.currentPage;
                }
                param.resourceCategory = this.form.resourceClassId;
                param.resourceMedium = this.form.mediumId;
                param.projectType = this.form.resourceProjectId;

                /* this.startTimeEnd = this.form.startTime;
                this.endTimeEnd = this.form.endTime;
                this.resourceClassIdEnd = this.form.resourceClassId;
                this.mediumIdEnd = this.form.mediumId;
                this.resourceProjectIdEnd = this.form.resourceProjectId; */

                this.loading = true; 
                // axios.post('/statistics/resourceEfficiency/getResourceEfficientList',param).then(function (response) { 
                axios.post( search_url[parseInt(this.activeName)] ,param).then(function (response) { 
                    //console.log( response );
                    if(!response){
                        mainDivVM.loading = false;
                        mainDivVM.$message({
                            message: "接口调用失败",
                            type: 'error'
                        });
                        return ;
                    }
                    var resobj= response.data;
                    if(!resobj){
                        mainDivVM.loading = false;
                        mainDivVM.$message({
                            message: "接口调用失败",
                            type: 'error'
                        });
                        return ;
                    }
                    if(resobj.code!='0'){
                        mainDivVM.loading = false;
                        mainDivVM.$message({
                            message: resobj.msg,
                            type: 'error'
                        });
                        return ;
                    }else if(resobj.data && resobj.data.tableData && resobj.data.totalData ){
                        
                        var resobjData = resobj.data;    
                        var tableData = resobjData.tableData;
                        
                        if( mainDivVM.activeName=="0" ){
                            mainDivVM.tableDataFirst = mainDivVM.formatTreeList(tableData.data);
                            // mainDivVM.tableDataFirst = tableData.data;
                            if(tableData.data && tableData.data.length){
                                var totalData = resobjData.totalData[0];
                                mainDivVM.tableDataFirst.unshift(totalData);
                            }
                        }else{
                           mainDivVM.tableDataSecond = mainDivVM.formatTreeList(tableData.data);
                           // mainDivVM.tableDataSecond = tableData.data;
                            if(tableData.data && tableData.data.length){
                                var totalData = resobjData.totalData[0];
                                mainDivVM.tableDataSecond.unshift(totalData);
                            } 
                        }
                        
                        mainDivVM.pager.currentPage = tableData.currentPage;
                        mainDivVM.pager.total = tableData.total;
                        mainDivVM.loading = false;

                        // 给导出参数赋值
                        mainDivVM.export.startTime = mainDivVM.minuteFormat(startTime);
                        mainDivVM.export.endTime = mainDivVM.minuteFormat(endTime);
                        mainDivVM.export.resourceClassId = mainDivVM.form.resourceClassId;
                        mainDivVM.export.mediumId = mainDivVM.form.mediumId;
                        mainDivVM.export.resourceProjectId = mainDivVM.form.resourceProjectId;
                        
                        mainDivVM.startTimeEnd = mainDivVM.form.startTime;
                        mainDivVM.endTimeEnd = mainDivVM.form.endTime;
                        mainDivVM.resourceClassIdEnd = mainDivVM.form.resourceClassId;
                        mainDivVM.mediumIdEnd = mainDivVM.form.mediumId;
                        mainDivVM.resourceProjectIdEnd = mainDivVM.form.resourceProjectId;
                    }else{
                        mainDivVM.loading = false;

                        mainDivVM.startTimeEnd = mainDivVM.form.startTime;
                        mainDivVM.endTimeEnd = mainDivVM.form.endTime;
                        mainDivVM.resourceClassIdEnd = mainDivVM.form.resourceClassId;
                        mainDivVM.mediumIdEnd = mainDivVM.form.mediumId;
                        mainDivVM.resourceProjectIdEnd = mainDivVM.form.resourceProjectId;
                    }  
                }).catch(function (error) {
                    mainDivVM.loading = false;

                    mainDivVM.startTimeEnd = mainDivVM.form.startTime;
                    mainDivVM.endTimeEnd = mainDivVM.form.endTime;
                    mainDivVM.resourceClassIdEnd = mainDivVM.form.resourceClassId;
                    mainDivVM.mediumIdEnd = mainDivVM.form.mediumId;
                    mainDivVM.resourceProjectIdEnd = mainDivVM.form.resourceProjectId;

                    mainDivVM.$message({
                        message: "请求失败，请稍后重试",
                        type: "error"
                    });
                });
            },
            limitTime (start, end) {
                var startTime = this.minuteFormat (start);
                var endTime = this.minuteFormat (end);
                var date = new Date();
                data = this.minuteFormat (date);// 现在的时间
                data = data.slice(0,8);
                if(startTime){
                    var s = startTime.slice(0,8);
                    if(s < data){
                        this.form.startTime = moment(start).format("YYYY-MM-DD 00:00");
                        return this.form.startTime;
                    }
                    return start;
                }
                if(endTime){
                    var e = endTime.slice(0,8);
                    if(e < data){
                        this.form.endTime = moment(end).format("YYYY-MM-DD 23:59");
                        return this.form.endTime;                        
                    }
                    return end;
                }
            },
            arraySpanMethod({ row, column, rowIndex, columnIndex }) { // 合并第一行
                if (rowIndex === 0) {
                    /*if (columnIndex === 0) {
                        return [0, 1];
                    } else if (columnIndex === 1) {
                        return [1, 2];
                    }*/
                    // if (columnIndex === 0) {
                    //     return [0,1];
                    // } else if (columnIndex === 1) {
                    //     return [1,3];
                    // }else if ( columnIndex === 3) {
                    //     return [0, 0];
                    // }
                    /*if (columnIndex === 1) {
                        return [1,3];
                    } else if (columnIndex === 2 || columnIndex === 3) {
                        return [0, 0];
                    }*/
                     if (columnIndex === 0) {
                             return [0, 0];
                       } else if (columnIndex === 1) {
                             return [1, 3];
                       } else if (columnIndex === 2) {
                             return [0, 0];
                       } 
                }
            },
            indexFun (index) { // 表格序号
                return index;
            },
            nullToZero(row, column, value, index){
                if(value){
                    return value;
                }
                return 0;
            },
           /* gotoTeam (row) { // 页面跳转
                var orgId = row.orgId; // 电销组id
                var orgName = row.orgName; // 电销组name
                var startTime = this.export.startTime;
                var endTime = this.export.endTime;
                if(orgId === "0" && orgName === "合计"){
                    window.location.href="/statistics/teleStatement/telemarketingCallTableSum?orgId=" + this.export.orgId + "&startTime=" + startTime + "&endTime=" + endTime;
                }else if(orgId){
                    window.location.href="/statistics/teleStatement/telemarketingCallTableTeam?orgId=" + orgId + "&startTime=" + startTime + "&endTime=" + endTime; 
                }
            },*/
            indexFun (index) { // 表格序号
                return index;
            },
            minuteFormat (m) {
                if (!m) {return "";}
                var timeStr = new Date(m);
                var yearRes = timeStr.getFullYear()
                var monthRea = timeStr.getMonth()+1;
                monthRea = monthRea < 10 ?  "0" + monthRea : monthRea;
                var dateRes = timeStr.getDate();
                dateRes = dateRes < 10 ?  "0" + dateRes : dateRes;  
                var hoursRes = timeStr.getHours();
                hoursRes = hoursRes < 10 ?  "0" + hoursRes : hoursRes;  
                var minRes = timeStr.getMinutes();
                minRes = minRes < 10 ?  "0" + minRes : minRes;                
                var timeRes = "" + yearRes + monthRea + dateRes + hoursRes + minRes;
                return timeRes;
            },
            summaryFun () {
                var total = {
                    orgId: "合计",
                    orgName: '合计',
                    callCount: 1000,
                    calledCount: 10,
                    callPercent: 10,
                    callClueCount: 10,
                    calledClueCount: 10,
                    clueCallecdPrecent: 10,
                    validCallTime: 155799,
                    userAvgDayValidCallTime: 155799
                };
                this.tableData.unshift(total);
            },
            minuteFormat (m) { // 时间格式化201905050505fn
                if (!m) {return "";}
                var timeStr = new Date(m);
                var yearRes = timeStr.getFullYear();
                var monthRea = timeStr.getMonth()+1;
                monthRea = monthRea < 10 ?  "0" + monthRea : monthRea;
                var dateRes = timeStr.getDate();
                dateRes = dateRes < 10 ?  "0" + dateRes : dateRes;  
                var hoursRes = timeStr.getHours();
                hoursRes = hoursRes < 10 ?  "0" + hoursRes : hoursRes;  
                var minRes = timeStr.getMinutes();
                minRes = minRes < 10 ?  "0" + minRes : minRes;                
                var timeRes = "" + yearRes + monthRea + dateRes + hoursRes + minRes;
                return timeRes;
            },
            percentFormat (row, column) { // 百分比格式化fn
                var percent = row[column.property];
                if(!percent){ // 如果没有值或值为0
                    return 0 + "%";
                }
                percent = (percent * 1000)/10 + "%";
                return percent;
            },
            timeFormat (row, column) { // 时间格式化：时分秒fn
                var time = row[column.property];
                if(!time){return "00时00分00秒";}
                var timeResult = this.timeFun (time); 
                return timeResult;
            },
            timeFun(s){
                var t="";
                var hour = Math.floor(s/3600);
                var min = Math.floor(s/60) % 60;
                var sec = s % 60;
                if(hour<10){t+="0";}
                t+=hour+"时"
                if(min < 10){t += "0";}
                t += min + "分";
                if(sec < 10){t += "0";}
                t += sec + "秒";
                return t;
            },
            searchYesterday(){ // 昨天
               var today = new Date();
               today.setTime(today.getTime()-24*60*60*1000);
               var startTime = today.getFullYear()+"-" + (today.getMonth()+1) + "-" + today.getDate()+" 00:00";
               var endTime =today.getFullYear()+"-" + (today.getMonth()+1) + "-" + today.getDate()+" 23:59";
               this.form.startTime=startTime;
               this.form.endTime=endTime;
               this.searchTable(1);
            },
            searchWeek(){ // 近七天
                 var a = new Date();
                 var year = a.getFullYear();
                 var month = a.getMonth();
                 var date = a.getDate();
                 var b = new Date(year,month,date);
                 var c = b.valueOf()-6*24*60*60*1000;
                 var d = b.valueOf();
                 var startTime= new Date(c);
                 var endTime = new Date(d);
                 this.form.startTime=startTime.getFullYear()+"-" + (startTime.getMonth()+1) + "-" + startTime.getDate()+" 00:00";
                 this.form.endTime=endTime.getFullYear()+"-" + (endTime.getMonth()+1) + "-" + endTime.getDate()+" 23:59";
                 this.searchTable(1);
            },
            searchMonth(){ // 本月 
                var a = new Date();
                var year = a.getFullYear();
                var month = a.getMonth();
                var date = a.getDate();
                var b = new Date(year,month,date);
                var f= new Date(year,month,01);
                var c = f.valueOf();
                var startTime= new Date(c);
                this.form.startTime=startTime.getFullYear()+"-" + (startTime.getMonth()+1) + "-" + startTime.getDate()+" 00:00";
                this.form.endTime=year+"-"+(month+1)+"-"+date+" 23:59";
                this.searchTable(1);
            },
            exportRs(){
                var param = {};
                param.startTime = this.export.startTime;
                param.endTime = this.export.endTime;
                param.resourceCategory =  this.export.resourceClassId; 
                param.resourceMedium =  this.export.mediumId; 
                param.projectType =  this.export.resourceProjectId; 
                axios.post('/statistics/resourceEfficiency/exportResourceEfficiency',param,{responseType:'blob'})
                    .then(function (response) {
                        var data =  response.data;
                        var fileName = response.headers.filename;
                        saveAs(data,decodeURI(fileName));
                    })
                    .catch(function (error) {
                        mainDivVM.$message({
                            message: "导出失败，请稍后重试",
                            type: "error"
                        });
                    });
            }
        },
        created(){
            // 默认进入显示当天时间
            var today = new Date();
            var startTime = moment(today).format("YYYY-MM-DD 00:00");
            var endTime = moment(today).format("YYYY-MM-DD 23:59");
            this.form.startTime=startTime;
            this.form.endTime=endTime; 
            // if(curOrgId){this.isDisabled= true;}
            this.export.startTime = this.minuteFormat(this.form.startTime);
            this.export.endTime = this.minuteFormat(this.form.endTime);
            var localVal=localStorage.getItem('allChangePageSize')?parseInt(localStorage.getItem('allChangePageSize')):'';
            if(localVal){this.pager.pageSize = localVal;}
            this.searchTable();

            /*this.startTimeEnd = this.form.startTime;
            this.endTimeEnd = this.form.endTime;
            this.resourceClassIdEnd = this.form.resourceClassId;
            this.mediumIdEnd = this.form.mediumId;
            this.resourceProjectIdEnd = this.form.resourceProjectId;*/
        },
        mounted(){
            document.getElementById('maindiv').style.display = 'block';
        }
    })
    
</script>
</html>